var SocialCommunication = function( vars, ref, set )	{

	Object.extend( obj = $$( '.SocialPicasa form' ).pop(), SocialCommunication.proto );
	
	obj.button 		= obj.select( ".add" )[0];
	
	obj.vars		= vars;
	
	obj.ref 		= ref;
		
	if( set ) obj.seed( set );
	console.log(obj);
	return obj;
}


SocialCommunication.proto =	{

	add			: function() {
		
		this.button.observe( "click", this.add_album.bind( this ) );
		
	},
	
	toggle			: function( e ) {
	
		this.lists.invoke( "toggleClassName", "hide" );
	
	},
	
	activate		: function( e ) {
		
		obj = e.element( e ) //e.currentTarget;
		
		this.buttonlis.invoke( "removeClassName", "active" );
		obj.addClassName( 'active' );
		
		var value = obj.value; 
		xhttp.send( '/xhttp.mod', {
			mod: "text.search",
			action: "pull_abc",
			vars: { vars: this.vars, value: value }
		}, this.pull_response.bind( this ) );
	},
			
	pull_response	: function( response ) {
		
		string = response.responseText;
		
		if( string.isJSON() ) {
			
			this.holder.update();
			string.evalJSON().each( this.render_li, this );
			
		} else this.holder.update( string );
		
			
	
	},
	
	render_li		: function( el ) {
	
		this.holder.insert( "<li " + (( el.date)? "class='li_year'" : "") + ">" + (( el.uri)? "<a class='name' href='" + el.uri + "'>" : "<span class='name'>" ) + el.name + (( el.uri)? "</a>": "</span>") + (( el.date )? "<span class='date'>" + el.date + "</span>" : "") + "</li>" );
	}
	
}